package com.pengxun.manager.enums;

/**
 * @author zhongzhu
 * @Title: code-manager
 * @Package com.szeastroc.manager.enums
 * @Description:
 * @date 2018/10/1516:23
 */
public enum BatchStatusEnum {

    DELETE(-2,"已删除"),

    EXECUTING(-1,"正在处理"),

    DISABLE(0,"未启用"),

    ENABLE(1,"启动"),
    ;

    private Integer type;

    private String desc;

    BatchStatusEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static BatchStatusEnum getEnumByType(Integer type){
        BatchStatusEnum[] enums = BatchStatusEnum.values();
        for(BatchStatusEnum statusEnum:enums){
            if(statusEnum.getType() == type){
                return statusEnum;
            }
        }
        return null;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
